Open Traffic Generator API (0.7.16)

Download OpenAPI specification:Download

Open Traffic Generator API defines a model-driven, vendor-neutral and standard interface for emulating layer 2-7 network devices and generating test traffic.

Contributions can be made in the following ways:

Configuration

set_config

Sets configuration resources on the traffic generator.

Request Body schema: application/json
Array of objects (Port)

The ports that will be configured on the traffic generator.

Array of objects (Lag)

The LAGs that will be configured on the traffic generator.

Array of objects (Layer1)

The layer1 settings that will be configured on the traffic generator.

Array of objects (Capture)

The capture settings that will be configured on the traffic generator.

Array of objects (Device)

The emulated devices that will be configured on the traffic generator. Each device contains configurations for network interfaces and protocols running on top of those interfaces.

Array of objects (Flow)

The flows that will be configured on the traffic generator.

object (Event)

The optional container for event configuration.

object (Config.Options)

Global configuration options.

Responses

Request samples

Content type
application/json
{
  • "ports": [
    ],
  • "lags": [
    ],
  • "layer1": [
    ],
  • "captures": [
    ],
  • "devices": [
    ],
  • "flows": [
    ],
  • "events": {
    },
  • "options": {
    }
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

get_config

Responses

Request samples

Content type
application/json
{
  • "ports": [
    ],
  • "lags": [
    ],
  • "layer1": [
    ],
  • "captures": [
    ],
  • "devices": [
    ],
  • "flows": [
    ],
  • "events": {
    },
  • "options": {
    }
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

get_config

Responses

Response samples

Content type
application/json
{
  • "ports": [
    ],
  • "lags": [
    ],
  • "layer1": [
    ],
  • "captures": [
    ],
  • "devices": [
    ],
  • "flows": [
    ],
  • "events": {
    },
  • "options": {
    }
}

Control

set_transmit_state

Updates the state of configuration resources on the traffic generator. =======

Response samples

Content type
application/json
{
  • "ports": [
    ],
  • "lags": [
    ],
  • "layer1": [
    ],
  • "captures": [
    ],
  • "devices": [
    ],
  • "flows": [
    ],
  • "events": {
    },
  • "options": {
    }
}

Control

set_transmit_state

Updates the state of configuration resources on the traffic generator. >>>>>>> master The Response.Warnings in the Success response is available for implementers to disclose additional information about a state change including any implicit changes that are outside the scope of the state change.

Request Body schema: application/json
flow_names
Array of strings

The names of flows to which the transmit state will be applied to. If the list of flow_names is empty or null the state will be applied to all configured flows. If the list is not empty any flow that is not included in the list of flow_names MUST be ignored and not included in the state change.

x-constraint:

  • /components/schemas/Flow/properties/name
state
required
string
Enum: "start" "stop" "pause" "resume"

The transmit state. If the value of the state property is 'start' then all flows defined by the 'flow_names' property will be started and the metric counters MUST be cleared prior to starting the flow(s). If the value of the state property is 'stop' then all flows defined by the 'flow_names' property will be stopped and the metric counters MUST NOT be cleared. If the value of the state property is 'pause' then all flows defined by the 'flow_names' property will be paused and the metric counters MUST NOT be cleared. If the value of the state property is 'resume' then any paused flows defined by the 'flow_names' property will start transmit at the point at which they were paused. Any flow that is stopped will start transmit at the beginning of the flow. The flow(s) MUST NOT have their metric counters cleared.

Responses

Request samples

Content type
application/json
{
  • "flow_names": [
    ],
  • "state": "start"
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

set_capture_state

Updates the state of configuration resources on the traffic generator.

Request Body schema: application/json
port_names
Array of strings

The names of ports to which the capture state will be applied to. If the list of port_names is empty or null the state will be applied to all configured ports. If the list is not empty any port that is not included in the list of port_names MUST be ignored and not included in the state change.

x-constraint:

  • /components/schemas/Port/properties/name
state
required
string
Enum: "start" "stop"

The capture state.

Responses

Request samples

Content type
application/json
{
  • "port_names": [
    ],
  • "state": "start"
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

update_flows

Updates flow properties without disruption of transmit state.

Request Body schema: application/json
property_names
required
Array of strings
Items Enum: "rate" "size"

Flow properties to be updated without affecting the transmit state.

required
Array of objects (Flow)

The list of configured flows for which given property will be updated.

Responses

Request samples

Content type
application/json
{
  • "property_names": [
    ],
  • "flows": [
    ]
}

Response samples

Content type
application/json
{
  • "ports": [
    ],
  • "lags": [
    ],
  • "layer1": [
    ],
  • "captures": [
    ],
  • "devices": [
    ],
  • "flows": [
    ],
  • "events": {
    },
  • "options": {
    }
}

set_route_state

Updates the state of configuration resources on the traffic generator.

=======

Request samples

Content type
application/json
{
  • "property_names": [
    ],
  • "flows": [
    ]
}

Response samples

Content type
application/json
{
  • "ports": [
    ],
  • "lags": [
    ],
  • "layer1": [
    ],
  • "captures": [
    ],
  • "devices": [
    ],
  • "flows": [
    ],
  • "events": {
    },
  • "options": {
    }
}

set_route_state

Updates the state of configuration resources on the traffic generator.

>>>>>>> master
Request Body schema: application/json
names
Array of strings

The names of device route objects to control. If no names are specified then all route objects that match the x-constraint will be affected.

x-constraint:

  • /components/schemas/Bgp.V4RouteRange/properties/name
  • /components/schemas/Bgp.V6RouteRange/properties/name
  • /components/schemas/Isis.V4RouteRange/properties/name
  • /components/schemas/Isis.V6RouteRange/properties/name
state
required
string
Enum: "withdraw" "advertise"

Route specific states

Responses

Request samples

Content type
application/json
{
  • "names": [
    ],
  • "state": "withdraw"
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

send_ping

API to send an IPv4 and/or IPv6 ICMP Echo Request(s) between endpoints. For each endpoint 1 ping packet will be sent and API shall wait for ping response to either be successful or timeout. The API wait timeout for each request is 300ms.

Request Body schema: application/json
Array of objects (Ping)

Array of ping requests

Responses

Request samples

Content type
application/json
{
  • "endpoints": [
    ]
}

Response samples

Content type
application/json
{
  • "responses": [
    ]
}

set_protocol_state

Sets all configured protocols to start or stop state.

Request Body schema: application/json
state
required
string
Enum: "start" "stop"

Protocol specific states

Responses

Request samples

Content type
application/json
{
  • "state": "start"
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

set_device_state

Set specific state/actions on device configuration resources on the traffic generator.

Request Body schema: application/json
choice
string
Value: "lacp_member_state"
object (LacpMember.State)

Set LACP state for specified LAG Member Port(s).

Responses

Request samples

Content type
application/json
{
  • "choice": "lacp_member_state",
  • "lacp_member_state": {
    }
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

Metrics

get_metrics

Request Body schema: application/json

Request to traffic generator for metrics of choice

choice
string
Default: "port"
Enum: "port" "flow" "bgpv4" "bgpv6" "isis" "lag" "lacp_lag_member"
object (Port.Metrics.Request)

The port result request to the traffic generator

object (Flow.Metrics.Request)

The container for a flow metric request.

object (Bgpv4.Metrics.Request)

The request to retrieve BGPv4 per peer metrics/statistics.

object (Bgpv6.Metrics.Request)

The request to retrieve BGPv6 per peer metrics/statistics.

object (Isis.Metrics.Request)

The request to retrieve ISIS per Router metrics/statistics.

object (Lag.Metrics.Request)

The request to retrieve per LAG metrics/statistics.

object (LacpLagMember.Metrics.Request)

The request to retrieve LACP per LAG member metrics/statistics.

Responses

Request samples

Content type
application/json
{
  • "choice": "port",
  • "port": {
    },
  • "flow": {
    },
  • "bgpv4": {
    },
  • "bgpv6": {
    },
  • "isis": {
    },
  • "lag": {
    },
  • "lacp_lag_member": {
    }
}

Response samples

Content type
application/json
{
  • "choice": "port_metrics",
  • "port_metrics": [
    ],
  • "flow_metrics": [
    ],
  • "bgpv4_metrics": [
    ],
  • "bgpv6_metrics": [
    ],
  • "isis_metrics": [
    ],
  • "lag_metrics": [
    ],
  • "lacp_lag_member_metrics": [
    ]
}

States

get_states

Request Body schema: application/json

Request to traffic generator for states of choice

choice
string
Default: "ipv4_neighbors"
Enum: "ipv4_neighbors" "ipv6_neighbors" "bgp_prefixes"
object (Neighborsv4.States.Request)

The request to retrieve IPv4 Neighbor state (ARP cache entries) of a network interface(s).

object (Neighborsv6.States.Request)

The request to retrieve IPv6 Neighbor state (NDISC cache entries) of a network interface(s).

object (BgpPrefix.State.Request)

The request to retrieve BGP peer prefix information.

Responses

Request samples

Content type
application/json
{
  • "choice": "ipv4_neighbors",
  • "ipv4_neighbors": {
    },
  • "ipv6_neighbors": {
    },
  • "bgp_prefixes": {
    }
}

Response samples

Content type
application/json
{
  • "choice": "ipv4_neighbors",
  • "ipv4_neighbors": [
    ],
  • "ipv6_neighbors": [
    ],
  • "bgp_prefixes": [
    ]
}

Capture

get_capture

Request Body schema: application/json

Capture results request to the traffic generator.

port_name
required
string

The name of a port a capture is started on.

x-constraint:

  • /components/schemas/Port/properties/name

Responses

Request samples

Content type
application/json
{
  • "port_name": "string"
}

Response samples

Content type
application/json
{
  • "errors": [
    ]
}